<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::name('/')->get('/', function () {
    return view('Home.Index.index');
});

Route::name('error')->get('/error', function () { //404页面
    return view('Home.Index.404');
});

Route::name('index')->get('/index', function () {
    return view('Home.Index.index');
});

Route::name('job')->match(['get', 'post'], '/job', 'Home\IndexController@job');

Route::name('job_resume_add')->match(['get', 'post'], '/user/resume/job_resume_add/{obj}', 'Home\User\ResumeController@add');//简历添加

Route::name('login')->match(['get', 'post'], '/login', 'Home\LoginController@Login')/*->middleware('throttle:5,1')*/;

Route::name('logout')->match(['get', 'post'], '/logout', 'Home\LoginController@logout');

//Route::name('utest')->match(['get', 'post'], '/utest', 'Home\RoleController@utest');

Route::group(['prefix'=>'tools'],function () {
    Route::name('file_upload')->post('/file_upload', 'ToolsController@file_upload');
    Route::name('file__exists')->get('/file__exists', 'ToolsController@file__exists');
    Route::name('file_download')->get('/file_download', 'ToolsController@file_download');
});

Route::group(['middleware' => 'auth:web','prefix'=>'user'],function () {

    Route::name('user_index')->get('/index', 'Home\User\IndexController@index');

    /*** 客户  s ***/
    Route::group(['middleware' => ['check_user_type2', 'check_user_type3', 'check_user_branch1'],'prefix'=>'client'],function () {

        Route::name('client_all')->match(['get', 'post'], '/all', 'Home\User\ClientController@all');

        Route::name('client_all')->match(['get', 'post'], '/', 'Home\User\ClientController@all');

        Route::name('client_private')->match(['get', 'post'], '/private', 'Home\User\ClientController@private');

        Route::name('add_client')->match(['get', 'post'], '/add', 'Home\User\ClientController@add');

        Route::name('client_buy')->match(['get', 'post'], '/client_buy/{obj}', 'Home\User\ClientController@buy');//简历购买

        Route::name('edit_client')->match(['get', 'post'], '/edit/{obj}', 'Home\User\ClientController@edit');

        Route::name('del_client')->match(['get', 'post'], '/del/{obj}', 'Home\User\ClientController@del');

        Route::name('add_client_schedule')->match(['get', 'post'], '/add_client_schedule/{obj}', 'Home\User\ClientScheduleController@add_schedule');

        Route::name('client_schedule_download')->match(['get', 'post'], '/client_schedule_download/{obj}', 'Home\User\ClientScheduleController@download');

    });
    /*** 客户  e ***/

    /*** 渠道管理  s ***/
    Route::group(['middleware' => ['check_user_type2', 'check_user_type3', 'check_user_branch1'],'prefix'=>'channel'],function () {

        Route::name('part_list')->match(['get', 'post'], '/part_list', 'Home\User\PartController@part_list');  //渠道 兼职渠道

        Route::name('add_part')->match(['get', 'post'], '/add_part', 'Home\User\PartController@add');//新增 兼职渠道

        Route::name('edit_part')->match(['get', 'post'], '/edit_part/{obj}', 'Home\User\PartController@edit');//编辑 兼职渠道

        Route::name('del_part')->match(['get', 'post'], '/del_part/{obj}', 'Home\User\PartController@del');//删除 兼职渠道

        Route::name('add_part_schedule')->match(['get', 'post'], '/add_part_schedule/{obj}', 'Home\User\PartScheduleController@add_schedule');//跟进 兼职渠道

        Route::name('part_schedule_download')->match(['get', 'post'], '/part_schedule_download/{obj}', 'Home\User\PartScheduleController@download');

        Route::name('recruit_list')->match(['get', 'post'], '/recruit_list', 'Home\User\RecruitController@recruit_list');  //渠道 招聘渠道

        Route::name('add_recruit')->match(['get', 'post'], '/add_recruit', 'Home\User\RecruitController@add');//新增 招聘渠道

        Route::name('edit_recruit')->match(['get', 'post'], '/edit_recruit/{obj}', 'Home\User\RecruitController@edit');//编辑 招聘渠道

    });
    /*** 渠道管理  e ***/

    /*** 职位管理 s ***/
    Route::group(['prefix'=>'position'],function () {

        Route::name('position_self')->match(['get', 'post'],'/', 'Home\User\PositionController@self')->middleware('check_user_type3');//我的职位

        Route::name('position_self')->match(['get', 'post'],'/self', 'Home\User\PositionController@self')->middleware('check_user_type3');//我的职位

        Route::name('position_all')->match(['get', 'post'],'/all', 'Home\User\PositionController@all')->middleware('check_user_type2','check_user_type3');//所有职位

        Route::name('position_add')->match(['get', 'post'], '/position_add', 'Home\User\PositionController@add')->middleware('check_user_type2', 'check_user_type3');//职位添加

        Route::name('position_edit')->match(['get', 'post'], '/position_edit/{obj}', 'Home\User\PositionController@edit')->middleware('check_user_type3');//职位修改

        Route::name('position_push')->match(['get', 'post'], '/position_push/{obj}', 'Home\User\PositionController@position_push')->middleware('check_user_type3');//推荐简历

        Route::name('position_resume')->match(['get', 'post'], '/position_resume/{obj}', 'Home\User\PositionController@position_resume')->middleware('check_user_type3');//已推荐简历

        Route::name('position_del')->match(['get', 'post'], '/position_del/{obj}', 'Home\User\PositionController@position_del')->middleware('check_user_type3');//删除简历
		
		
    });
    /*** 职位管理 e ***/

    /*** 职位简历跟进 e ***/
    Route::group(['prefix'=>'deliver'],function () {

        Route::name('add_position_schedule')->match(['get', 'post'],'add_position_schedule/{obj}', 'Home\User\DeliverScheduleController@add_position_schedule')->middleware('check_user_type2', 'check_user_type3', 'check_user_branch1');//职位跟进

        Route::name('add_resume_schedule')->match(['get', 'post'],'add_resume_schedule/{obj}', 'Home\User\DeliverScheduleController@add_resume_schedule');//简历跟进

    });
    /*** 职位简历跟进 s ***/

    /*** 简历管理 s ***/
    Route::group(['prefix'=>'resume'],function () {

        Route::name('resume_self')->match(['get', 'post'],'/', 'Home\User\ResumeController@self')->middleware('check_user_type3');//我的简历池

        Route::name('resume_self')->match(['get', 'post'],'/self', 'Home\User\ResumeController@self')->middleware('check_user_type3');//我的简历池

        Route::name('resume_all')->match(['get', 'post'],'/all', 'Home\User\ResumeController@all')->middleware('check_user_type2', 'check_user_type3', 'check_user_branch1');//所有简历池

        Route::name('resume_add')->match(['get', 'post'], '/user/resume/resume_add', 'Home\User\ResumeController@add')->middleware('check_user_type3');//简历添加

        Route::name('resume_edit')->match(['get', 'post'], '/resume_edit/{obj}', 'Home\User\ResumeController@edit')->middleware('check_user_type3');//简历修改

        Route::name('resume_push')->match(['get', 'post'], '/resume_push/{obj}', 'Home\User\ResumeController@resume_push')->middleware('check_user_type3');//推荐职位

        Route::name('resume_position')->match(['get', 'post'], '/resume_position/{obj}', 'Home\User\ResumeController@resume_position')->middleware('check_user_type3');//已推荐职位

        Route::name('resume_del')->match(['get', 'post'], '/resume_del/{obj}', 'Home\User\ResumeController@resume_del')->middleware('check_user_type3');//删除已推荐

        Route::name('del')->match(['get', 'post'], '/del/{obj}', 'Home\User\ResumeController@del')->middleware('check_user_type3');//删除已推荐

        Route::name('resume_download')->match(['get', 'post'], '/resume_download/{obj}', 'Home\User\ResumeController@download')->middleware('check_user_type2', 'check_user_type3', 'check_user_branch1');  //简历-下载

        Route::name('resume_buy')->match(['get', 'post'], '/resume_buy/{obj}', 'Home\User\ResumeController@buy')->middleware('check_user_type2', 'check_user_type3', 'check_user_branch1');//简历购买

    });
    /*** 简历管理 e ***/

    /*** 数据报表 s ***/
    Route::group(['middleware' => ['check_user_type2', 'check_user_type3', 'check_user_branch1'],'prefix'=>'data'],function () {

        /*** 数据报告 ***/
        Route::name('recommend_list')->match(['get', 'post'],'/', 'Home\User\DataController@recommend_list');

        Route::name('recommend_list')->match(['get', 'post'],'/recommend_list', 'Home\User\DataController@recommend_list');

        Route::name('finance_list')->match(['get', 'post'],'/finance_list','Home\User\DataController@finance_list');//财务数据

        Route::name('add_finance_schedule')->match(['get', 'post'], '/add_finance_schedule/{obj}', 'Home\User\DataController@add_finance_schedule');

        Route::name('finance_edit')->match(['get', 'post'],'/finance_edit/{obj}', 'Home\User\DataController@finance_edit');//财务数据-编辑

        Route::name('ranking1')->match(['get', 'post'],'/ranking1_list', 'Home\User\DataController@ranking1_list');  //排行榜-本月回款排行榜

        Route::name('ranking2')->match(['get', 'post'],'/ranking2_list', 'Home\User\DataController@ranking2_list');  //排行榜-本月推荐排行榜

        Route::name('ranking3')->match(['get', 'post'],'/ranking3_list', 'Home\User\DataController@ranking3_list');  //排行榜-本月offer排行榜

        Route::name('ranking4')->match(['get', 'post'],'/ranking4_list', 'Home\User\DataController@ranking4_list'); //排行榜-面试数据汇总

    });
    /*** 数据报表 e ***/


    /*** 人事管理 s ***/
    Route::group(['middleware' => ['check_user_type2', 'check_user_type3'],'prefix'=>'hr'],function () {

        Route::name('hr_person')->match(['get', 'post'],'/person', 'Home\Hr\PersonController@person');  //（首屏）-人员信息

        Route::name('person_add')->match(['get', 'post'],'/person_add', 'Home\Hr\PersonController@person_add');  //（首屏）-人员添加

        Route::name('person_edit')->match(['get', 'post'],'/person_edit/{obj}', 'Home\Hr\PersonController@person_edit');  //（首屏）-人员编辑

        Route::name('up_salary')->match(['get', 'post'],'/up_salary/{obj}', 'Home\Hr\PersonController@up_salary');  //（首屏）-升职加薪编辑

        Route::name('hr_promotion')->match(['get', 'post'],'/promotion/{obj}/{up_obj?}', 'Home\Hr\PersonController@promotion');  //（首屏）-升职加薪记录

        Route::name('hr_salary')->match(['get', 'post'],'/salary', 'Home\Hr\SalaryController@salary');  //薪酬管理

        Route::name('salary_add')->match(['get', 'post'],'/salary_add', 'Home\Hr\SalaryController@salary_add');  //薪酬管理

        Route::name('salary_edit')->match(['get', 'post'],'/salary_edit/{obj}', 'Home\Hr\SalaryController@salary_edit');  //薪酬管理

        Route::name('salary_del')->match(['get', 'post'],'/salary_del/{obj}', 'Home\Hr\SalaryController@salary_del');  //薪酬管理

        Route::name('hr_notice')->match(['get', 'post'],'/notice', 'Home\Hr\NoticeController@notice');  //公告管理

        Route::name('notice_add')->match(['get', 'post'],'/notice_add', 'Home\Hr\NoticeController@notice_add')->middleware('role:admin|leader');  //公告管理-添加

        Route::name('notice_edit')->match(['get', 'post'],'/notice_edit/{obj}', 'Home\Hr\NoticeController@notice_edit')->middleware('role:admin|leader');  //公告管理-编辑

        Route::name('notice_del')->match(['get', 'post'],'/notice_del/{obj}', 'Home\Hr\NoticeController@notice_del')->middleware('role:admin|leader');  //公告管理-编辑

        Route::name('hr_knowledge')->match(['get', 'post'],'/knowledge', 'Home\Hr\KnowledgeController@knowledge');  //知识分享

        Route::name('knowledge_add')->match(['get', 'post'],'/knowledge_add', 'Home\Hr\KnowledgeController@knowledge_add')->middleware(['role:admin|leader']);  //知识分享-添加

        Route::name('knowledge_edit')->match(['get', 'post'],'/knowledge_edit/{obj}', 'Home\Hr\KnowledgeController@knowledge_edit')->middleware('role:admin|leader');  //知识分享-编辑

        Route::name('del_knowledge')->match(['get', 'post'],'/del_knowledge/{obj}', 'Home\Hr\KnowledgeController@del_knowledge')->middleware('role:admin|leader');  //知识分享-删除

        Route::name('del_file_knowledge')->match(['get', 'post'],'/del_file_knowledge/{obj}', 'Home\Hr\KnowledgeController@del_file_knowledge')->middleware('role:admin|leader');  //知识分享-删除

        Route::name('knowledge_download')->match(['get', 'post'], '/knowledge_download/{obj}', 'Home\Hr\KnowledgeController@download');  //知识分享-下载

        Route::name('notice_detail')->match(['get', 'post'],'/notice_detail/{obj}', 'Home\Hr\NoticeController@notice_detail');  //公告管理-详情
        Route::name('knowledge_detail')->match(['get', 'post'],'/knowledge_detail/{obj}', 'Home\Hr\KnowledgeController@knowledge_detail');  //知识分享-详情


    });
    /*** 人事管理 e ***/

    /*** 设置  s ***/
    Route::group(['middleware' => ['role:admin'],'prefix'=>'set'],function () {

        Route::name('company_info')->match(['get', 'post'], '/', 'Home\Set\CompanyController@company_info');//基本设置-组织架构

        Route::name('company_info')->match(['get', 'post'], '/company_info', 'Home\Set\CompanyController@company_info');//基本设置-组织架构

        Route::name('login_log')->match(['get', 'post'], '/login_log', 'Home\Set\LoginLogController@login_log');  //基本设置-登录日志

        Route::name('protection')->match(['get', 'post'], '/protection_info', 'Home\Set\ProtectionController@protection_info');      //基本设置-保护设置

        Route::name('frame')->match(['get', 'post'], '/frame', 'Home\Set\FrameController@frame');//基本设置-组织架构

        Route::name('frame_admin_add')->match(['get', 'post'], '/frame_admin_add/', 'Home\Set\FrameController@frame_admin_add');//基本设置-组织架构-添加经理

        Route::name('frame_add')->match(['get', 'post'], '/frame_add/{obj?}', 'Home\Set\FrameController@frame_add');//基本设置-组织架构-添加

        Route::name('frame_edit')->match(['get', 'post'], '/frame_edit/{obj?}', 'Home\Set\FrameController@frame_edit');//基本设置-组织架构-添加

        Route::name('frame_del')->match(['get', 'post'], '/frame_del/{obj?}', 'Home\Set\FrameController@frame_del');//基本设置-组织架构-删除

        Route::name('mac_log')->match(['get', 'post'], '/mac_log', 'Home\Set\MacController@mac_log');//基本设置-指定MAC地址

        Route::name('mac_add')->match(['get', 'post'], '/mac_add/{obj?}', 'Home\Set\MacController@mac_add');//基本设置-MAC地址-添加

        Route::name('mac_edit')->match(['get', 'post'], '/mac_edit/{obj?}', 'Home\Set\MacController@mac_edit');//基本设置-MAC地址-添加

        Route::name('mac_del')->match(['get', 'post'], '/mac_del/{obj?}', 'Home\Set\MacController@mac_del');//基本设置-MAC地址-删除

        Route::name('config_set')->match(['get', 'post'], '/config_set', 'Home\Set\ConfigController@config_set');//基本设置

        Route::name('download_list')->match(['get', 'post'], '/download_list', 'Home\Set\DownloadController@download_list');      //基本设置-猎头下载资源

        Route::name('download_user_list')->match(['get', 'post'], '/download_user_list/{uid}', 'Home\Set\DownloadController@download_user_list');      //基本设置-猎头下载资源

        Route::name('download_edit')->match(['get', 'post'], '/download_edit/{obj}', 'Home\Set\DownloadController@download_edit');      //基本设置-猎头下载资源

    });
    /*** 设置  e ***/
});
